<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var array1 = new Array(7);
			console.log(array1.length); // 7
			var array2 = new Array(100, 'a', true);
			console.log(array2.length);
			
			// 创建了一个空数组，数组的长度是可变的，类似于ArrayList
			var array = new Array();
			array[0] = '123';
			console.log(array);// ["123"]
			console.log(array.length);// 1
			array[1] = true;
			console.log(array);// ["123", true]
			console.log(array.length);// 2
			
			// 使用push和pop分别对应栈的入栈和出栈操作
			var arr = new Array();
			arr.push('zhangsan');
			console.log(arr);["zhangsan"]
			arr.push(true);
			console.log(arr);// ["zhangsan", true]
			arr.push(45);
			console.log(arr);// ["zhangsan", true, 45]
			console.log(arr[2]);
			console.log(arr.pop());
			console.log(arr.pop());
			console.log(arr.pop());
			console.log(arr);
			
		</script>
	</head>
	<body>
	</body>
</html>
